From 171088463eaa2d7e7c35091d0ba6a1399c7f89e5 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 3 Aug 2006 20:42:13 +0000 Subject: [PATCH] Zero struct tm on timestamp read so if time tag is malformed, we don't have hour number 17347896 or whatever else happened to be there. --- gpsbabel/gpx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index b6bbdfe13..07f3ecdd6 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -735,6 +735,8 @@ xml_parse_time( const char *cdatastr ) struct tm tm; time_t rv = 0; char *timestr = xstrdup( cdatastr ); + + memset(&tm, 0, sizeof(tm)); offsetstr = strchr( timestr, 'Z' ); if ( offsetstr ) { -- 2.30.2